package com.sghd.pojo.candy.fight.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sghd.pojo.fight.game.ExitReason;
import com.sghd.pojo.fight.game.RoomType;
import com.sghd.pojo.fight.game.Sn;


/**
 * @author Allen
 * @date 2018/12/03
 */
public class SettleTo extends Sn {
    /**获胜方玩家ID*/
    private Long winId;
    /**获胜方玩家初始血量*/
    private Integer initBlood;
    /**获胜方玩家剩余血量*/
    private Integer leftBlood;
    /**获胜方玩家对局内获得游戏币*/
    private Integer winGetMoney;
    /**失败方玩家ID*/
    private Long loseId;
    /**获胜方玩家对局内获得游戏币*/
    private Integer loseGetMoney;
    /**房间类型*/
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private RoomType roomType;
    /** 结算原因*/
    private ExitReason reason;

    /** PVE关卡 */
    /** 章节 */
    private Integer bigLevelId;
    /** 关卡 */
    private Integer smallLevelId;
    /** 回合数*/
    private Integer round;

    public Long getWinId() {
        return winId;
    }

    public void setWinId(Long winId) {
        this.winId = winId;
    }

    public Integer getInitBlood() {
        return initBlood;
    }

    public void setInitBlood(Integer initBlood) {
        this.initBlood = initBlood;
    }

    public Integer getLeftBlood() {
        return leftBlood;
    }

    public void setLeftBlood(Integer leftBlood) {
        this.leftBlood = leftBlood;
    }

    public Integer getWinGetMoney() {
        return winGetMoney;
    }

    public void setWinGetMoney(Integer winGetMoney) {
        this.winGetMoney = winGetMoney;
    }

    public Long getLoseId() {
        return loseId;
    }

    public void setLoseId(Long loseId) {
        this.loseId = loseId;
    }

    public Integer getLoseGetMoney() {
        return loseGetMoney;
    }

    public void setLoseGetMoney(Integer loseGetMoney) {
        this.loseGetMoney = loseGetMoney;
    }

    public RoomType getRoomType() {
        return roomType;
    }

    public void setRoomType(RoomType roomType) {
        this.roomType = roomType;
    }

    public Integer getBigLevelId() {
        return bigLevelId;
    }

    public void setBigLevelId(Integer bigLevelId) {
        this.bigLevelId = bigLevelId;
    }

    public Integer getSmallLevelId() {
        return smallLevelId;
    }

    public void setSmallLevelId(Integer smallLevelId) {
        this.smallLevelId = smallLevelId;
    }

    public Integer getRound() {
        return round;
    }

    public void setRound(Integer round) {
        this.round = round;
    }

    public long getSn() {
        return sn;
    }

    public void setSn(long sn) {
        this.sn = sn;
    }

    /**
     * PVP实例
     * @param sn
     * @param winId
     * @param initBlood
     * @param leftBlood
     * @param winGetMoney
     * @param loseId
     * @param loseGetMoney
     * @param reason
     * @return
     */
    public static SettleTo valueOf(Long winId, Integer initBlood, Integer leftBlood,
                                   Integer winGetMoney, Long loseId, Integer loseGetMoney, ExitReason reason) {
        SettleTo settleTo = new SettleTo();
        settleTo.setWinId(winId);
        settleTo.setInitBlood(initBlood);
        settleTo.setLeftBlood(leftBlood);
        settleTo.setWinGetMoney(winGetMoney);
        settleTo.setLoseId(loseId);
        settleTo.setLoseGetMoney(loseGetMoney);
        settleTo.setRoomType(RoomType.PVP);
        settleTo.reason = reason;
        return settleTo;
    }

    /**
     * PVE实例
     * @param roomId
     * @param winId
     * @param initBlood
     * @param leftBlood
     * @param winGetMoney
     * @param bigLevelId
     * @param smallLevelId
     * @param round
     * @param reason
     * @return
     */
    public static SettleTo valueOf(Long winId, Integer initBlood, Integer leftBlood,
                                   Integer winGetMoney, Integer bigLevelId, Integer smallLevelId,
                                   Integer round, ExitReason reason) {
        SettleTo settleTo = new SettleTo();
        settleTo.setWinId(winId);
        settleTo.setInitBlood(initBlood);
        settleTo.setLeftBlood(leftBlood);
        settleTo.setWinGetMoney(winGetMoney);
        settleTo.setBigLevelId(bigLevelId);
        settleTo.setSmallLevelId(smallLevelId);
        settleTo.setRoomType(RoomType.PVE);
        settleTo.setRound(round);
        settleTo.reason = reason;
        return settleTo;
    }

    public ExitReason getReason() {
        return reason;
    }

    public void setReason(ExitReason reason) {
        this.reason = reason;
    }
}
